package com.ask.controller.test;

import com.ask.dto.Result;
import com.ask.exception.BaseException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test/ex")
public class ExcpetionController {

    @GetMapping
    public Result exTest(Long id){
        if (id < 0)
            throw new BaseException("id格式错误！");
        return Result.success("id:" + id);
    }
}
